package test8;

public class TestBoat {
    public static void main(String[] args) {
        Boat boat = new Boat(10072,432.45,"china",2012);
        SailBoat sailBoat = new SailBoat(1033,12.3,"china",2021,3,111);
        PowerBoat powerBoat = new PowerBoat(1043,17.3,"china",2021,2,3);
        System.out.println(boat.toString());
        System.out.println(sailBoat.toString());
        System.out.println(powerBoat.toString());
        //创建一个Boat (船) 类，它有四个属性:registrationNo (注册号) 、length (长)manufacturer (制造商) 、year (年)，方法tostring返回所有属性的值。
        //SailBoat (帆船) 类和PowerBoat (汽艇)类继承Boat类，SailBoat类还有keelDepth (龙骨深度)和id (帆船编号) 属性， PowerBoat还有numberEgines (引擎数)和fuelType (燃料类型属性。在SailBoat类和PowerBoat类重写toString方法(要求调用父类方法)
        //分别创建三个类的对象，使用setter或构造方法赋值

    }
}
